<?php
include_once 'include/control/context.php.inc';
include_once 'include/control/JobsControl.php';

$model = getjobs();

$title="itjobs.sinaapp.com, 基于新浪微博的IT招聘求职应用";
$keywords ="itjobs,itjobs2011,it求职，it招聘，微博招聘";
$description = "itjobs.sinaapp.com, 基于新浪微博的IT招聘求职应用，微博招聘";

include_once 'include/parts/header.php.inc';
include_once 'include/parts/jobcategories.php';
?>

<div id="right">
    <!--welcome-->
    <div class="round_10 p15 welcome">
      <h1><?php echo $model-> category-> screen_name ;?></h1> <br />
      <p><?php echo $model-> category->notes;?></p>      
    </div>
    <!--welcome end-->
    
    <!--list-->
    <div id="job_list" class="mt20">
      <div class="top tr"><input type="button" onclick="javascript:location.href='/job/new'" class="orange_btn round_15" value="发布新的职位" title="发布新的职位" /></div>
      <div class="list">
        <ul>
        <?php 
        foreach ($model-> jobs as $item) {
          echo '<li>';
          echo '  <div class="l"><a href="/hr/'.$item->User->id.'"><img src="'. $item->User->profile_image_url .'" alt="'.$item->User->name .'" /></a></div>';
          echo '  <div class="r">';
          echo '    <h4><a href="/job/'. $item->id .'">'.$item->title .'</a></h4>';
          echo '    <p class="pt5">'.mb_substr($item-> body,0,200,'utf-8') .'...</p>';
          echo '    <p class="l_black tools"><span class="icon_publisher">发布人：<a href="/hr/'.$item->User->id.'">'. $item->User->name .'</a></span><span class="icon_comments"><a href="/job/'. $item->id .'#replies">'. $item->reply_count .'人评论</a></span><span class="icon_ReleaseTime">发布日期：'. $item->post_date .'</span></p>';
          echo '  </div>';
          echo '</li> ';
        } ?>         
        </ul>
        <div class="paging mt20">
          <p class="right"><?php 
          if($model->offset!=0){
          	echo '<a href="/?offset='. ($model->offset - 15) .'">上一页</a>';
          }
          if(($model->offset+15)<$model->recordCount){
          	echo '<a href="/?offset='. ($model->offset+15) .'">下一页</a>';
          }          
          ?></p>
          <p>第&nbsp;<strong><?php echo $model->offset + 1;?></strong>-<strong><?php echo $model->realCount>=15 ? $model->offset+15 :$model->offset + $model->realCount ;?></strong>&nbsp;个，共&nbsp;<strong><?php echo $model->recordCount;?></strong>&nbsp;个</p>
        </div>
      </div>
    </div>
    <!--list end-->
</div>  
<script type="text/javascript">
<!--
var category_id='<?php echo $model-> category-> id ;?>';
//-->
</script>

<?php
include_once 'include/parts/footer.php.inc';
?>